/*
 * AbstractTarget.java
 *
 * Created on Dec 20, 2011
 *
 * Copyright (c) 2011 Artur Rataj.
 *
 * This code is distributed under the terms of the GNU Library
 * General Public License, either version 3 of the license or, at
 * your option, any later version.
 */

package pl.gliwice.iitis.spatialnn.network;

import pl.gliwice.iitis.graphutils.Point;

/**
 * An abstract target for a neuron's input or output.
 * 
 * @author Artur Rataj
 */
public abstract class AbstractTarget {
    /**
     * For an output target, index of the target neuron's or membrane's input. For an input target,
     * the default of -1.
     */
    public int index;
    
    /**
     * Creates a new instance of <code>AbstractTarget</code>.
     */
    public AbstractTarget() {
        this.index = -1;
    }
    /**
     * Returns the location of this target.
     * 
     * @param network network, which contains this target
     * @return location in the network's coordinate
     */
    public abstract Point getLoc(Network network);
    /**
     * Returns if this target points to the same component as some
     * other target. Membrane expressions are meaningless for this method.
     * 
     * @param other the other target
     * @return if the targets represent a common component
     */
    public abstract boolean componentsEqual(AbstractTarget other);
    /**
     * Returns this target describes without arithmetic rounding.
     * 
     * @return a string exactly describing this target
     */
    public abstract String toStringExact();
}
